package com.tpu.osu.rating.web.pages;

import java.util.Date;

import org.apache.tapestry.annotations.InjectPage;
import org.apache.tapestry.annotations.OnEvent;
import org.apache.tapestry.annotations.Parameter;
import org.apache.tapestry.ioc.annotations.Inject;

import com.tpu.osu.rating.TimeService;

public class Rating {

	@Inject
	private TimeService timeService;
	
	@InjectPage
	private Rating ratingPage;

	@Parameter
	private String userID;

	
	public String getTime() {
		return timeService.getTime().toLocaleString();
	}
	
	public String getUserID() {
		return userID;
	}
	
	public void setUserID(String aID) {
		userID = aID;
	}

	public void onActivate(Object[] aParams) {
		if (aParams != null && aParams.length > 0)
			userID = aParams[0].toString();
	}
	
	
	public Object onSuccess() {
		ratingPage.userID = userID;
		return ratingPage;
	}


}
